package learn_concurrent._1;

import java.util.concurrent.locks.LockSupport;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class T17 {
	final static Logger logger = LoggerFactory.getLogger(T17.class);

	public static void main(String[] args) {
		test1();
	}

	private static void test1() {
		Thread t1 = new Thread(() -> {
			logger.debug("park...");
			LockSupport.park();
			logger.debug("unpark...");
//			logger.debug("打断状态：{}", Thread.currentThread().isInterrupted());
			logger.debug("打断状态：{}", Thread.interrupted());
			
			LockSupport.park();
			logger.debug("unpark......");
		});

		t1.start();
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		t1.interrupt();
	}

}
